﻿using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Three.BookStore.LoginERP;

namespace Three.BookStore.RBAC
{
    public interface IPermissions
    {
        /// <summary>
        /// 创建权限
        /// </summary>
        /// <param name="permission">权限信息</param>
        /// <returns>创建结果（1：成功，0：失败）</returns>
        Task<int> CreatePermissionAsync(PermissionModel permission);

        /// <summary>
        /// 更新权限
        /// </summary>
        /// <param name="permission">权限信息</param>
        /// <returns>更新结果（1：成功，0：失败）</returns>
        Task<int> UpdatePermissionAsync(PermissionModel permission);

        /// <summary>
        /// 删除权限
        /// </summary>
        /// <param name="id">权限ID</param>
        /// <returns>删除结果（1：成功，0：失败）</returns>
        Task<int> DeletePermissionAsync(int id);

        /// <summary>
        /// 获取权限详情
        /// </summary>
        /// <param name="id">权限ID</param>
        /// <returns>权限信息</returns>
        Task<PermissionModel> GetPermissionByIdAsync(int id);

        /// <summary>
        /// 获取所有权限列表
        /// </summary>
        /// <returns>权限列表</returns>
        Task<List<PermissionModel>> GetAllPermissionsAsync();
    }
}
